﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PigLatinTranslator;

namespace Igpay_atinlay_anlstorlray
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            textBox2.ReadOnly = true;
            igpayAtinlayAnslatetrayToolStripMenuItem.Enabled = false;
        }


        private void englishPigLatinToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Clear the text
            textBox2.Text = "";
            textBox2.ReadOnly = false;
            //Translate the text and place it into the pig latin textbox
            textBox2.Text = Translator.EnglishToPigLatin(textBox1.Text);
            textBox1.Text = "";
            textBox1.ReadOnly = true;
            igpayAtinlayAnslatetrayToolStripMenuItem.Enabled = true;
            englishPigLatinToolStripMenuItem.Enabled = false;
        }

        private void igpayAtinlayAnslatetrayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Clear the text
            textBox1.Text = "";
            textBox1.ReadOnly = false;
            //Translate the text and place it into the english textbox
            textBox1.Text = Translator.PigLatinToEnglish(textBox2.Text);
            textBox2.Text = "";
            textBox2.ReadOnly = true;
            englishPigLatinToolStripMenuItem.Enabled = true;
            igpayAtinlayAnslatetrayToolStripMenuItem.Enabled = false;
        }
    }
}
